<template>
  <view class="container">
    <view class="follow-user" @touchmove.stop="false">
      <view class="follow-item" v-for="(item, index) in 10" :key="index">
        <image class="follow-userhead" src="/static/image/system.png" mode="widthFix"></image>
        <view class="follow-username">用户名</view>
      </view>
    </view>

    <view class="post-card">
      <view class="post-header">
        <image src="/static/avatar.png" class="avatar"></image>
        <view class="post-info">
          <text class="username">41呀</text>
          <text class="timestamp">01-17 16:47</text>
        </view>
        <image src="/static/more-icon.png" class="more-icon"></image>
      </view>

      <!-- Image Carousel (Placeholder) -->
      <view class="image-carousel">
        <image src="/static/watermelon.jpg" mode="widthFix" class="post-image"></image>
        <text class="image-count">2/16</text>
        <!-- Dots would go here -->
      </view>

      <!-- Actions -->
      <view class="post-actions">
        <view class="action-item">
          <image src="/static/repost-icon.png" class="action-icon"></image>
        </view>
        <view class="action-item">
          <image src="/static/heart-icon.png" class="action-icon"></image>
          <text class="action-count">242</text>
        </view>
        <view class="action-item">
          <image src="/static/star-icon.png" class="action-icon"></image>
          <text class="action-count">259</text>
        </view>
        <view class="action-item">
          <image src="/static/comment-icon.png" class="action-icon"></image>
          <text class="action-count">128</text>
        </view>
      </view>

      <!-- Content Text -->
      <view class="post-content">
        <text>杭州40℃的高温,不来一个清热大西瓜</text>
      </view>

      <!-- Comments Section -->
      <view class="comments-section">
        <view class="comment-item">
          <text class="comment-username">用户名</text>
          <text class="comment-text">用户评论用户评论用户评论用户评论用户评论</text>
          <text class="comment-date">2025-04-22 回复</text>
        </view>
        <view class="comment-item">
          <text class="comment-username">用户名</text>
          <text class="comment-author-tag">作者</text>
          <text class="comment-text">用户评论用户评论用户评论用户评论用户评论</text>
          <text class="comment-date">2025-04-22 回复</text>
        </view>
        <text class="expand-replies">展开2条回复</text>
      </view>
    </view>

    <view class="suggested-users-section">
      <view class="section-header">
        <text class="section-title">你可能感兴趣的人</text>
        <text class="view-more">查看更多 ></text>
      </view>
      <view class="suggested-users-list" @touchmove.stop="false">
        <!-- Suggested User Item -->
        <view class="suggested-user-item">
          <image src="/static/avatar.png" class="suggested-avatar"></image>
          <text class="suggested-username">51呀</text>
          <text class="suggested-source">推荐来自于动漫</text>
          <button class="follow-button">关注</button>
        </view>
        <view class="suggested-user-item">
          <image src="/static/avatar.png" class="suggested-avatar"></image>
          <text class="suggested-username">51呀</text>
          <text class="suggested-source">推荐来自于动漫</text>
          <button class="follow-button">关注</button>
        </view>
        <view class="suggested-user-item">
          <image src="/static/avatar.png" class="suggested-avatar"></image>
          <text class="suggested-username">51呀</text>
          <text class="suggested-source">推荐来自于动漫</text>
          <button class="follow-button">关注</button>
        </view>
      </view>
    </view>

    <view class="post-card" v-for="(item, index) in 10" :key="index" @click="navTo(`/pages/find/detail?id=${item.id}`)">
      <view class="post-header">
        <image src="/static/avatar.png" class="avatar"></image>
        <view class="post-info">
          <text class="username">41呀</text>
          <text class="timestamp">01-17 16:47</text>
        </view>
        <image src="/static/more-icon.png" class="more-icon"></image>
      </view>

      <!-- Image Carousel (Placeholder) -->
      <view class="image-carousel">
        <image src="/static/watermelon.jpg" mode="widthFix" class="post-image"></image>
        <text class="image-count">2/16</text>
        <!-- Dots would go here -->
      </view>

      <!-- Actions -->
      <view class="post-actions">
        <view class="action-item">
          <image src="/static/repost-icon.png" class="action-icon"></image>
        </view>
        <view class="action-item">
          <image src="/static/heart-icon.png" class="action-icon"></image>
          <text class="action-count">242</text>
        </view>
        <view class="action-item">
          <image src="/static/star-icon.png" class="action-icon"></image>
          <text class="action-count">259</text>
        </view>
        <view class="action-item">
          <image src="/static/comment-icon.png" class="action-icon"></image>
          <text class="action-count">128</text>
        </view>
      </view>

      <!-- Content Text -->
      <view class="post-content">
        <text>杭州40℃的高温,不来一个清热大西瓜</text>
      </view>

      <!-- Comments Section -->
      <view class="comments-section">
        <view class="comment-item">
          <text class="comment-username">用户名</text>
          <text class="comment-text">用户评论用户评论用户评论用户评论用户评论</text>
          <text class="comment-date">2025-04-22 回复</text>
        </view>
        <view class="comment-item">
          <text class="comment-username">用户名</text>
          <text class="comment-author-tag">作者</text>
          <text class="comment-text">用户评论用户评论用户评论用户评论用户评论</text>
          <text class="comment-date">2025-04-22 回复</text>
        </view>
        <text class="expand-replies">展开2条回复</text>
      </view>
    </view>

  </view>
</template>

<script>
export default {
  data() {
    return {

    }
  },
  methods: {
    navTo(url) {
      uni.navigateTo({ url: url })
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  background: #f7f7f7;
  height: 100%;
  overflow: auto;
}

.follow-user {
  padding: 10px 10px;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow-x: auto;

  .follow-item {
    display: inline-block;
    text-align: center;
    padding: 0 15rpx;

    .follow-userhead {
      width: 96rpx;
      border-radius: 50%;
      display: block;
    }

    .follow-username {
      font-size: 24rpx;
      color: #000000;
      line-height: 24rpx;
      margin-top: 12rpx;
    }
  }
}

.post-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.post-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.username {
  font-weight: bold;
  font-size: 16px;
}

.timestamp {
  font-size: 12px;
  color: #999;
}

.more-icon {
  width: 24px;
  height: 24px;
}

.image-carousel {
  position: relative;
  margin-bottom: 10px;
}

.post-image {
  width: 100%;
  border-radius: 4px;
}

.image-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.post-actions {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.action-item {
  display: flex;
  align-items: center;
}

.action-icon {
  width: 20px;
  height: 20px;
  margin-right: 5px;
}

.action-count {
  font-size: 14px;
  color: #555;
}

.post-content {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.5;
}

.comments-section {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.comment-item {
  margin-bottom: 8px;
  font-size: 14px;
}

.comment-username {
  font-weight: bold;
  margin-right: 5px;
}

.comment-author-tag {
  background-color: #ffebee;
  /* Light red background */
  color: #c62828;
  /* Dark red text */
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 5px;
}

.comment-text {
  line-height: 1.4;
}

.comment-date {
  font-size: 12px;
  color: #999;
  margin-left: 5px;
}

.expand-replies {
  color: #007aff;
  /* Blue color */
  font-size: 13px;
  margin-top: 5px;
  display: inline-block;
}

.suggested-users-section {
  background-color: #fff;
  padding: 10px;
  background: #f8f8f8;

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;

    .section-title {
      font-size: 16px;
      font-weight: bold;
    }

    .view-more {
      font-size: 13px;
      color: #007aff;
    }
  }

  .suggested-users-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 5px;

    .suggested-user-item {
      flex-shrink: 0;
      width: 240rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-right: 10px;
      padding: 10px;
      background-color: #fff;
      border-radius: 8px;

      .suggested-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-bottom: 5px;
      }

      .suggested-username {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 2px;
      }

      .suggested-source {
        font-size: 11px;
        color: #777;
        margin-bottom: 8px;
      }

      .follow-button {
        background-color: #007aff;
        color: #fff;
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 4px;
        border: none;
        cursor: pointer;
      }
    }
  }
}
</style>